<template>
  <el-button class="clearbtn" @click="hzClear(obj)">重置</el-button>
</template>

<script>
export default {
  props: {
    obj: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {};
  },
  methods: {
    hzClear(obj) {
      for (const key in obj) {
        // console.log(key)
        if (key === "pageDate") {
          obj[key] = {
            pageNum: 1,
            pageSize: 10,
          };
        } else if (Array.isArray(obj[key])) {
          obj[key] = [];
        } else if (typeof obj[key] === "number") {
          obj[key] = "";
        } else {
          obj[key] = "";
        }
      }
      this.$emit("dj", obj);
    },
  },
};
</script>

<style lang="scss" scoped>
.clearbtn {
  width: 80px;
  height: 42px;
  border-radius: 21px;
  border: 1px solid #666666;
  color: #333333;
}
</style>
